import request from '@/utils/request'

// 查询售后管理列表
export function listAfterSale(query) {
  return request({
    url: '/shopping/afterSale/list',
    method: 'get',
    params: query
  })
}

// 查询售后管理详细
export function getAfterSale(afterSaleId) {
  return request({
    url: '/shopping/afterSale/' + afterSaleId,
    method: 'get'
  })
}

// 新增售后管理
export function addAfterSale(data) {
  return request({
    url: '/shopping/afterSale',
    method: 'post',
    data: data
  })
}

// 修改售后管理
export function updateAfterSale(data) {
  return request({
    url: '/shopping/afterSale',
    method: 'put',
    data: data
  })
}

// 删除售后管理
export function delAfterSale(afterSaleId) {
  return request({
    url: '/shopping/afterSale/' + afterSaleId,
    method: 'delete'
  })
}

// 导出售后管理
export function exportAfterSale(query) {
  return request({
    url: '/shopping/afterSale/export',
    method: 'get',
    params: query
  })
}

// 退款操作
export function updateRefund(afterSaleId,afterSaleState){
  const data = {
    afterSaleId,
    afterSaleState
  }
  return request({
    url: '/shopping/afterSale/updateRefund',
    method: 'put',
    data :data
  })
}
